package com.qf.tenement.tenement_rent.controller;

import com.qf.tenement.tenement_entity.ResultData;
import com.qf.tenement.tenement_rent.Renting;
import com.qf.tenement.tenement_rent.service.RentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.ws.rs.POST;

@RestController
public class RentController {

    @Resource
    private RentService rentService;


    @GetMapping("/rentlist")
    public ResultData rentlist(){
        return rentService.selectAll();
    }

    @PostMapping("/rentAdd")
    public ResultData rentAdd(@PathVariable Renting renting){
        return rentService.rentAdd(renting);
    }

    @GetMapping("/rentDelect")
    public ResultData rentDelect(String roomId){
        return rentService.rentDelect(roomId);
    }
}
